package FourHomeworkDesign.Composite;

import java.util.ArrayList;

/**
 * @author 北巷_东坡
 * @date 2022/11/11 20:17
 * @computer 10741
 */
public class Institution206 extends Unit206{
    private ArrayList list=new ArrayList();
    private String name;

    public Institution206(String name) {
        this.name = name;
    }

    public void add(Unit206 unit206){
        list.add(unit206);
    }

    @Override
    public void handleArchives() {
        System.out.println(name);
        for (Object object:list) {
            ((Unit206)object).handleArchives();
        }
    }
}
